﻿using System;
using System.Collections.Generic;
using System.Text;

namespace gChartSharp
{
    public class LineChart : ChartBase
    {
        /// <summary>
        /// 
        /// </summary>
        public override ChartType ChartType { get { return ChartType.lc; } }


        #region Member Variables
        private ColorParam mColors;
        private SolidFillParam mSolidFill;
        private DataScaleParam mDataScale;
        private LinearGradientFillParam mLinearGradientFill;
        private LinearStripesFillParam mLinearStripesFill;
        private TitleParam mTitle;
        private LegendParam mLegend;
        private AxisTypeParam mAxisType;
        private AxisStyleParam mAxisStyle;
        private AxisLabelParam mAxisLabel;
        private AxisLabelPositionParam mAxisLabelPosition;
        private AxisRangeParam mAxisRangeParam;
        private GridLinesParam mGridLines;
        private ShapeMarkerParam mShapeMarker;
        private RangeMarkerParam mRangeMarker;
        private LineStyleParam mLineStyle;
        private FillAreaParam mFillArea;
        #endregion


        #region Properties
        public ColorParam Colors
        {
            get { return mColors ?? (mColors = new ColorParam()); }
            set { mColors = value; }
        }


        public SolidFillParam SolidFill
        {
            get { return mSolidFill ?? (mSolidFill = new SolidFillParam()); }
            set { mSolidFill = value; }
        }


        public DataScaleParam DataScale
        {
            get { return mDataScale ?? (mDataScale = new DataScaleParam()); }
            set { mDataScale = value; }
        }


        public LinearGradientFillParam LinearGradientFill
        {
            get { return mLinearGradientFill ?? (mLinearGradientFill = new LinearGradientFillParam()); }
            set { mLinearGradientFill = value; }
        }


        public LinearStripesFillParam LinearStripesFill
        {
            get { return mLinearStripesFill ?? (mLinearStripesFill = new LinearStripesFillParam()); }
            set { mLinearStripesFill = value; }
        }


        public TitleParam Title
        {
            get { return mTitle ?? (mTitle = new TitleParam()); }
            set { mTitle = value; }
        }


        public LegendParam Legend
        {
            get { return mLegend ?? (mLegend = new LegendParam()); }
            set { mLegend = value; }
        }


        public AxisTypeParam AxisTypes
        {
            get { return mAxisType ?? (mAxisType = new AxisTypeParam()); }
            set { mAxisType = value; }
        }


        public AxisStyleParam AxisStyles
        {
            get { return mAxisStyle ?? (mAxisStyle = new AxisStyleParam()); }
            set { mAxisStyle = value; }
        }


        public AxisLabelParam AxisLabels
        {
            get { return mAxisLabel ?? (mAxisLabel = new AxisLabelParam()); }
            set { mAxisLabel = value; }
        }


        public AxisLabelPositionParam AxisLabelPositions
        {
            get { return mAxisLabelPosition ?? (mAxisLabelPosition = new AxisLabelPositionParam()); }
            set { mAxisLabelPosition = value; }
        }


        public AxisRangeParam AxisRange
        {
            get { return mAxisRangeParam ?? (mAxisRangeParam = new AxisRangeParam()); }
            set { mAxisRangeParam = value; }
        }


        public GridLinesParam GridLines
        {
            get { return mGridLines ?? (mGridLines = new GridLinesParam()); }
            set { mGridLines = value; }
        }


        public ShapeMarkerParam ShapeMarkers
        {
            get { return mShapeMarker ?? (mShapeMarker = new ShapeMarkerParam()); }
            set { mShapeMarker = value; }
        }


        public RangeMarkerParam RangeMarkers
        {
            get { return mRangeMarker ?? (mRangeMarker = new RangeMarkerParam()); }
            set { mRangeMarker = value; }
        }


        public LineStyleParam LineStyles
        {
            get { return mLineStyle ?? (mLineStyle = new LineStyleParam()); }
            set { mLineStyle = value; }
        }


        public FillAreaParam FillArea
        {
            get { return mFillArea ?? (mFillArea = new FillAreaParam()); }
            set { mFillArea = value; }
        }
        #endregion


        public LineChart() { }

        public LineChart(int width, int height) 
            : base(width, height) { }

        public LineChart(int width, int height, EncodingType encType) 
            : base(width, height, encType) { }

        public LineChart(int width, int height, float[] dataSet) 
            : base(width, height, dataSet) { }

        public LineChart(int width, int height, EncodingType encType, float[] dataSet)
            : base(width, height, encType, dataSet) { }


        public override string GetURL()
        {
            StringBuilder sb = CreateBaseURL();
            base.RenderIChartParam(mColors, ref sb);
            base.RenderIChartParam(mSolidFill, ref sb);
            base.RenderIChartParam(mDataScale, ref sb);
            base.RenderIChartParam(mLinearGradientFill, ref sb);
            base.RenderIChartParam(mLinearStripesFill, ref sb);
            base.RenderIChartParam(mTitle, ref sb);
            base.RenderIChartParam(mLegend, ref sb);
            base.RenderIChartParam(mAxisType, ref sb);
            base.RenderIChartParam(mAxisStyle, ref sb);
            base.RenderIChartParam(mAxisLabel, ref sb);
            base.RenderIChartParam(mAxisLabelPosition, ref sb);
            base.RenderIChartParam(mAxisRangeParam, ref sb);
            base.RenderIChartParam(mGridLines, ref sb);
            base.RenderIChartParam(mShapeMarker, ref sb);
            base.RenderIChartParam(mRangeMarker, ref sb);
            base.RenderIChartParam(mLineStyle, ref sb);
            base.RenderIChartParam(mFillArea, ref sb);

            return sb.ToString();
        }

        public override string GetHTML()
        {
            return "";
        }
    }
}
